﻿using System.Linq;
using XRM.Security.DataAccess.Context;
using XRM.Security.DataAccess.Models;

namespace XRM.Security.DataAccess.Repositories.Impl
{
    public class UserPCRepository : BaseRepository<UserPC>
    {
        public UserPCRepository(IDbContext contextDb) : base(contextDb)
        {   
        }

        public IQueryable<PC> GetPCByUserId(int userId)
        {
            return GetAll( s => s.UserRegisterId == userId && !s.PC.IsDeleted ).Select( s => s.PC );
        }
    }
}
